<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="<s:property value="#application.website.keywords"/>" />
<meta name="description" content="<s:property value="#application.website.description"/>" />
<title>留言-<s:property value="#application.website.websiteName"/></title>
<link href="css/css.css"  type="text/css" rel="stylesheet"/>
<link href="css/css.css"  type="text/css" rel="stylesheet"/>
<script type="text/javascript" src="js/tools/jquery-1.4.2.min.js"></script>
<script>
 function check()
 {
      var reg=/^[0-9]+$/;
      var title=$.trim($("#title").val());
      var content=$.trim($("#content").val());
      if(title.length=="")
      {
        alert("标题不能为空!");
        return false;
      }
      if(content.length<1||content>300)
      {
        alert("标题不能为空!");
        return false;
      }
      return true;
 }
</script>
</head>

<body>
 <div id="container">
   <div id="Header">
     <jsp:include page="../header.jsp"></jsp:include>
   </div>
   <div id="PageBody">
     <div class="mina">
       <div class="subleft">
         <div class="subnav">
           <img src="images/zy_25.gif" />
           <ul>
			  <li><a href="feedback.action">在线留言</a></li>
           </ul>
           <div class="navbott">资合信-易通卡</div>
         </div>
         
           <jsp:include page="../context.jsp"></jsp:include>
        
       </div>
       <div class="subright">
         <div class="subright01">
           <div class="subtitle"><span>位置：在线留言</span><h1>在线留言</h1></div>
           <div class="subright02">
             <div class="submessage">
		    <table cellspacing="0" cellpadding="0" width="100%" 
                              border="0">
    <tbody>
      <tr align="middle">
        <td class="bo1" valign="center" align="right" 
                                height="30"><table cellspacing="0" cellpadding="0" width="100%" 
                                border="0">
            <tbody>
             <s:iterator value="list">
              <tr>
                <td><table cellspacing="1" cellpadding="0" width="100%"  align="center" bgcolor="#D0D0D0" border="0">
                    <tbody>
                      <tr>
                        <td  height="20" align="middle" bgcolor="#E9E9E9">
	                         <table cellspacing="0" cellpadding="0" width="97%" border="0">
	                            <tbody>
	                              <tr>
	                                <td 
	                                width="50%" align="left" valign="bottom" class="font">&nbsp;标题:<s:property value="title"/></td>
	                                <td align="right" width="50%"><span 
	                                class="font">留言人：<s:property value="username"/>&nbsp;发表于：<s:property value="datetime"/>&nbsp;</span> </td>
	                              </tr>
	                            </tbody>
	                        </table>
                        </td>
                      </tr>
                      <tr>
                        <td valign="middle" align="center" bgcolor="#F1F1F1" height="80">
	                        <table cellspacing="4" cellpadding="0" width="98%" border="0">
	                            <tbody>
	                              <tr>
	                                <td align="left" valign="middle" class="font" idth="509">留言内容:<s:property value="content"/></td>
	                              </tr>
	                              <tr>
	                                <td align="left" valign="middle" 
	                                class="fontcolor">回复内容:<s:property value="reply"/>&nbsp;&nbsp;&nbsp;&nbsp;<br/>回复时间:<s:property value="replyDatetime"/></td>
	                              </tr>
	                            </tbody>
	                        </table>
                        </td>
                      </tr>
                    </tbody>
                </table>
                </td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              </s:iterator>
              <tr>
                <td><div class="page" style="padding-top:25px">
                <s:if test="#request.list.size()!=0">
			      <s:set name="pageUrl" >feedback.action?page=</s:set>
		      <a href="${pageUrl}1">第一页</a>
		      <a href="${pageUrl}<s:property value="#request.pageObj.prePage"/>">&lt; 上一页 </a>
		      <s:set name="totalPage" value="#request.pageObj.totalPage"></s:set>
		      <s:set name="currentPage" value="#request.pageObj.currentPage"></s:set>
							   <s:if test="#currentPage<=0">
							      <s:set name="currentPage" value="1"></s:set>
							   </s:if>
							   <s:elseif test="#currentPage>#totalPage">
							      <s:set name="currentPage" value="#totalPage"></s:set>
							   </s:elseif>
							   
							   <s:if test="#totalPage%6>0">
							       <s:set name="pageSize" value="#totalPage/6+1"></s:set>
							   </s:if>
							   <s:else>
							       <s:set name="pageSize" value="#totalPage/6"></s:set>
							   </s:else>
							   <s:if test="#currentPage%6>0">
							       <s:set name="cPageSize" value="#currentPage/6+1"></s:set>
							   </s:if>
							   <s:else>
							       <s:set name="cPageSize" value="#currentPage/6"></s:set>
							   </s:else>
							   <s:set name="first" value="6*(#cPageSize-1)"></s:set>
							   <s:if test="#first==0">
							      <s:set name="first" value="1"></s:set>
							   </s:if>
							   <s:set name="last" value="#cPageSize*6"></s:set>
							   <s:if test="#last>#totalPage">
							      <s:set name="last" value="#totalPage"></s:set>
							   </s:if>
				
							     <s:bean name="org.apache.struts2.util.Counter" id="counter"> 
							       <s:param name="first" value="#first"/>
							       <s:param name="last" value="#last" />
							       <s:iterator status="status"> 
							         <s:if test="#currentPage==(#status.index+#first)">
							            <s:a href="%{pageUrl}%{#status.index+#first}" cssClass="on" ><s:property value="#status.index+#first" /></s:a>
							         </s:if>
							         <s:else>
							           <s:a href="%{pageUrl}%{#status.index+#first}" ><s:property value="#status.index+#first" /></s:a>
							         </s:else>
							       </s:iterator> 
							     </s:bean>
							     <s:if test="#last<#totalPage">
							       ......&nbsp;
							     </s:if>
		      <a href="${pageUrl}<s:property value="#request.pageObj.nextPage"/>">下一页 ></a>
		      <a href="${pageUrl}<s:property value="#request.pageObj.totalPage"/>">最后一页</a>
		   </s:if> 
                </div></td>
              </tr>
            </tbody>
          </table>           </td>
      </tr>
      
      
      <tr>
        <td><table cellspacing="1" cellpadding="0" width="100%" 
                                bgcolor="#D0D0D0" border="0">
            <tbody>
              <tr>
                <td bgcolor="#F1F1F1">
                 <form action="feedback!addFeedback.action" method="post" name="form1" id="form1" 
                                onsubmit="return check();">
                    <table cellspacing="0" cellpadding="2" width="100%" 
                                align="center" border="0">
                      <tbody>
                        <tr>
                          <td valign="top" align="center" width="49%" style="padding-top:10px"><table cellspacing="0" cellpadding="0" border="0">
                              <tbody>
                                
                                <tr>
                                  <td width="23" height="25" align="left" valign="middle"><span class="bc"><img 
                                height="16" 
                                src="images/icon_homepage.gif" 
                                width="16" /></span></td>
                                  <td width="39" height="25" align="left" valign="middle" class="font">标&nbsp;&nbsp;&nbsp;题</td>
                                  <td width="177" height="25" align="left" valign="middle"><input class="panel" id="title" name="feedback.title"
                                 style="border:solid 1px; border-color:#000000; height:16; width:130; "
                                maxlength="30" size="25"  />
                                  *</td>
                                </tr>
                                <tr>
                                  <td height="25" align="left" valign="middle"><img height="16" 
                                src="images/icon_edit_topic.gif" 
                                width="16" /></td>
                                  <td width="39" height="25" align="left" valign="middle" class="font"><font 
                                class="cha2">昵&nbsp;&nbsp;&nbsp;称</font></td>
                                  <td height="25" align="left" valign="middle"><input class="panel" id="username"  name="feedback.username" 
                               style="border:solid 1px; border-color:#000000; height:16; width:100; "
                                maxlength="20" size="15" value="匿名" />
                                  *</td>
                                </tr>
                                <tr>
                                  <td height="25" align="left" valign="middle"><img height="16" 
                                src="images/icon_email.gif" 
                                width="16" border="0" /></td>
                                  <td width="39" height="25" align="left" valign="middle" class="font"><font 
                                class="cha2">Email</font></td>
                                  <td height="25" align="left" valign="middle"><input class="panel" id="email"  name="feedback.email"
                                style="border:solid 1px; border-color:#000000; height:16; width:110; "
                                maxlength="50" size="19"  /></td>
                                </tr>
                                <tr>
                                  <td height="25" align="left" valign="middle"><img height="16" 
                                src="images/icon_ip.gif" 
                                width="16" border="0" /></td>
                                  <td height="25" align="left" valign="middle" class="font">电话</td>
                                  <td height="25" align="left" valign="middle"><input class="panel" id="tel"  name="feedback.tel"
                               style="border:solid 1px; border-color:#000000; height:16; width:70; "
                                maxlength="10" size="10" name="oicq" /></td>
                                </tr>
                                <tr>
                                  <td height="30" colspan="3" align="center" valign="middle"><input class="bottom" type="submit" value="提交" name="Submit" />
                                    &nbsp;&nbsp;
                                    <input class="bottom" type="reset" value="重填" name="Submit2" /></td>
                                </tr>
                              </tbody>
                          </table></td>
                          <td valign="top" align="middle" width="51%"><table cellspacing="0" cellpadding="1" width="270" 
                                border="0">
                            <tbody>
                              <tr>
                                <td colspan="2" align="left" class="font">留言内容:</td>
                              </tr>
                              <tr>
                                <td colspan="2"><textarea  id="content" name="feedback.content" rows="10" cols="34" type="text" style="width:250px; font-size:12px; height:80px">请填写内容!</textarea>
                                *</td>
                              </tr>
                            </tbody>
                          </table></td>
                        </tr>
                      </tbody>
                    </table>
                </form></td>
              </tr>
            </tbody>
        </table></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
    </tbody>
  </table>
		  </div>
           </div>
         </div>
       </div>
     </div>
   </div>
   <div id="Footer">
      <jsp:include page="../bottom.jsp"></jsp:include>
   </div>
 </div>
</body>
</html>
